/*
文件名称: index.css
完整存储路径: frontend/static/css/index.css
功能说明: 系统主页专用样式 - 功能导航中心设计
版本: 2.0.0
最后修改: 2025-01-27
使用方法: 仅在系统主页(index.html)中引入，不影响其他页面
*/

/* ===== CSS变量定义 ===== */
:root {
  --primary-color: #667eea;
  --primary-light: #7c8ff0;
  --primary-dark: #5a6fd8;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --gray-color: #6c757d;
  --border-color: #e9ecef;
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.2);
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --transition: all 0.3s ease;
}

/* ===== 基础样式重置 ===== */
.main-content-container {
  padding: 20px;
  background: #f8f9fa;
  min-height: calc(100vh - 60px);
}

/* ===== 欢迎信息区域 ===== */
.welcome-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-medium);
  color: white;
}

.welcome-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.welcome-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.welcome-title i {
  font-size: 2.2rem;
  color: rgba(255, 255, 255, 0.9);
}

.welcome-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 10px 0 0 0;
}

.welcome-actions {
  display: flex;
  gap: 15px;
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* ===== 统计卡片区域 ===== */
.stats-section {
  margin-bottom: 30px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.stat-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-color);
}

.stat-card.stat-primary::before { background: var(--primary-color); }
.stat-card.stat-success::before { background: var(--success-color); }
.stat-card.stat-warning::before { background: var(--warning-color); }
.stat-card.stat-info::before { background: var(--info-color); }

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
}

.stat-primary .stat-icon { background: var(--primary-color); }
.stat-success .stat-icon { background: var(--success-color); }
.stat-warning .stat-icon { background: var(--warning-color); }
.stat-info .stat-icon { background: var(--info-color); }

.stat-content {
  flex: 1;
}

.stat-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-color);
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark-color);
  margin: 0 0 8px 0;
}

.stat-change {
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-positive {
  color: var(--success-color);
}

.stat-negative {
  color: var(--danger-color);
}

/* ===== 快速操作区域 ===== */
.quick-actions-section {
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--dark-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i {
  color: var(--primary-color);
}

.section-subtitle {
  color: var(--gray-color);
  margin: 0;
  font-size: 0.9rem;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.action-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 25px;
  text-align: center;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  opacity: 0;
  transition: var(--transition);
  z-index: 1;
}

.action-card:hover::before {
  opacity: 0.05;
}

.action-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.action-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  position: relative;
  z-index: 2;
}

.action-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark-color);
  margin: 0 0 8px 0;
  position: relative;
  z-index: 2;
}

.action-desc {
  font-size: 0.9rem;
  color: var(--gray-color);
  margin: 0;
  position: relative;
  z-index: 2;
}

.action-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--success-color);
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 12px;
  z-index: 2;
}

/* ===== 数据概览区域 ===== */
.overview-section {
  margin-bottom: 30px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.overview-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.overview-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
}

.overview-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--dark-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.overview-title i {
  color: var(--primary-color);
}

.overview-actions {
  display: flex;
  gap: 8px;
}

.btn-mini {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-color);
}

.btn-mini:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.overview-content {
  padding: 20px 25px;
}

/* 系统状态列表 */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--border-radius-sm);
  background: #f8f9fa;
  transition: var(--transition);
}

.status-item:hover {
  background: #e9ecef;
}

.status-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.status-success i { color: var(--success-color); }
.status-info i { color: var(--info-color); }
.status-warning i { color: var(--warning-color); }
.status-danger i { color: var(--danger-color); }

.status-item span {
  font-size: 0.9rem;
  color: var(--dark-color);
  font-weight: 500;
}

/* ===== 最近活动区域 ===== */
.recent-activity-section {
  margin-bottom: 30px;
}

.activity-list {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background: #f8f9fa;
}

.activity-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark-color);
  margin: 0 0 4px 0;
}

.activity-desc {
  font-size: 0.85rem;
  color: var(--gray-color);
  margin: 0 0 4px 0;
}

.activity-time {
  font-size: 0.8rem;
  color: var(--gray-color);
  margin: 0;
}

/* ===== 按钮样式 ===== */
.btn-text {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-text:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-content-container {
    padding: 15px;
  }
  
  .welcome-content {
    flex-direction: column;
    text-align: center;
  }
  
  .welcome-title {
    font-size: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .quick-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
  }
  
  .action-card {
    padding: 20px;
  }
  
  .action-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .overview-header {
    padding: 15px 20px;
  }
  
  .overview-content {
    padding: 15px 20px;
  }
  
  .activity-item {
    padding: 15px 20px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .welcome-section {
    padding: 20px;
  }
  
  .stat-card {
    flex-direction: column;
    text-align: center;
  }
  
  .activity-item {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}

/* ===== 动画效果 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-card,
.action-card,
.overview-card,
.activity-item {
  animation: fadeInUp 0.6s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* ===== 加载状态 ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary-color);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
